package com.azkj.album.view.activity;

import android.app.Activity;
import android.content.Intent;
import android.view.View;

import com.azkj.album.R;
import com.azkj.album.utils.Utils;
import com.azkj.album.view.base.BaseActivity;
import com.bumptech.glide.Glide;

import butterknife.BindView;
import butterknife.OnClick;
import uk.co.senab.photoview.PhotoView;

public class PhotoViewActivity extends BaseActivity {

    @BindView(R.id.photoview)
    PhotoView mPhotoView;

    public static void start(Activity activity, String url) {
        Intent intent = new Intent(activity, PhotoViewActivity.class);
        intent.putExtra("url", url);
        activity.startActivity(intent);
    }

    @OnClick({R.id.iv_back})
    public void onClick(View v){
        if (Utils.isFastClick()) return;
        switch (v.getId()){
            case R.id.iv_back:
                finish();
                break;
        }
    }


    @Override
    protected int getLayoutId() {
        return R.layout.activity_photoview;
    }

    @Override
    public void initView() {


    }

    @Override
    public void initData() {
        String url = getIntent().getStringExtra("url");
        Glide.with(this).load(url).into(mPhotoView);

    }


    @Override
    protected void initPresenter() {

    }

    @OnClick(R.id.iv_back)
    void onBack() {
        finish();
    }

}
